Skip to content

Hotfix: gobby-hooks 0.1.1 (Windows extern block requires unsafe in edition 2024)#3

Merged
joshwilhelmi merged 1 commit intomainfrom
hotfix/ghook-0.1.1
Apr 17, 2026
Merged

Hotfix: gobby-hooks 0.1.1 (Windows extern block requires unsafe in edition 2024)#3
joshwilhelmi merged 1 commit intomainfrom
hotfix/ghook-0.1.1

Conversation

@joshwilhelmi
Copy link
Copy Markdown
Contributor

@joshwilhelmi joshwilhelmi commented Apr 17, 2026

Summary

Hotfix for gobby-hooks after the 0.1.0 release. Bumps to 0.1.1.

gobby-hooks 0.1.0 published to crates.io fine, but the
x86_64-pc-windows-msvc build target in the Release ghook workflow
failed because edition 2024 requires extern "system" { ... } to be
unsafe extern "system" { ... }. The #[cfg(windows)] path in
crates/ghook/src/detach.rs was the only such block in the
workspace, and Mac/Linux dev never exercised it.

What's in the release

  • Fixedcrates/ghook/src/detach.rs:36: unsafe extern "system" { fn FreeConsole() -> i32; }. One-line fix.
  • Bumpedcrates/ghook/Cargo.toml to 0.1.1, Cargo.lock regenerated.
  • CHANGELOG — new [0.1.1] — gobby-hooks section above [0.1.0].

(Branched off current main, not dev, because dev still tracks
the pre-rebase chain from PR #1.)

Test plan

  • cargo build -p gobby-hooks clean
  • cargo test -p gobby-hooks — 27 passing
  • cargo clippy -p gobby-hooks --all-targets -- -D warnings clean
  • Local install: ~/.gobby/bin/ghook updated to 0.1.1; compatibility stamp refreshed
  • After merge + gobby-hooks-v0.1.1 tag: Release ghook workflow succeeds across all 5 build targets and publishes the GitHub Release that 0.1.0 missed

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Windows build compilation error that prevented installation on Windows systems. Users can now successfully install and use the tool on Windows with the latest Rust environment.

…e 0.1.1

ghook 0.1.0 published to crates.io but the Windows build target
failed: edition 2024 requires `extern "system" { ... }` to be
`unsafe extern "system" { ... }`. Local Mac dev never exercised the
#[cfg(windows)] branch in detach.rs so it slipped through.

Fix is one line in crates/ghook/src/detach.rs:36 plus a Cargo.toml
bump to 0.1.1 and a CHANGELOG entry. Linux/Mac use the
#[cfg(unix)] setsid(2) branch and were never affected -- the
crates.io 0.1.0 install works on those platforms but not Windows.

Verified: cargo build/test/clippy clean (27 ghook tests passing).
Once gobby-hooks-v0.1.1 is tagged, the Release ghook workflow
should succeed across all 5 build targets and create the GitHub
Release that 0.1.0 missed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 17, 2026 08:52
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Version 0.1.1 release bumps package version and addresses Windows compilation compatibility with Rust Edition 2024 by marking the FreeConsole() FFI extern block as unsafe, allowing successful cargo install on Windows after the previous 0.1.0 release.

Changes

Cohort / File(s) Summary
Version Bump & Documentation
CHANGELOG.md, crates/ghook/Cargo.toml
Incremented package version from 0.1.0 to 0.1.1 and documented the Windows FFI compatibility fix in changelog.
FFI Safety Update
crates/ghook/src/detach.rs
Updated Windows FreeConsole() extern block declaration from extern "system" to unsafe extern "system" to comply with Rust Edition 2024 safety requirements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A Windows fix hops into the light,
Unsafe extern blocks compile just right,
Edition 2024 calls for safer ways,
Gobby-hooks installs again, hip hooray!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: a hotfix that updates gobby-hooks to version 0.1.1 to fix a Windows build failure related to marking an extern block as unsafe for Rust edition 2024.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/ghook-0.1.1

Comment @coderabbitai help to get the list of available commands and usage tips.

@joshwilhelmi joshwilhelmi merged commit fbd86f5 into main Apr 17, 2026
3 of 4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hotfix release for gobby-hooks to restore Windows builds under Rust 2024 edition rules by adjusting the only Windows-only FFI extern block, and bumping the crate to 0.1.1.

Changes:

  • Marked the Windows extern "system" block in detach() as unsafe extern "system" to satisfy Rust 2024 edition requirements.
  • Bumped gobby-hooks from 0.1.0 → 0.1.1 and updated Cargo.lock accordingly.
  • Added a CHANGELOG entry documenting the Windows build fix.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/ghook/src/detach.rs Updates the Windows-only FFI extern block to be unsafe under edition 2024.
crates/ghook/Cargo.toml Bumps gobby-hooks version to 0.1.1.
Cargo.lock Regenerates lockfile to reflect the new crate version.
CHANGELOG.md Adds release notes for gobby-hooks 0.1.1 describing the Windows fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.md

#### gobby-hooks

- **Windows build** — `crates/ghook/src/detach.rs` declared `extern "system" { fn FreeConsole() -> i32; }` for the Windows-only `FreeConsole()` call. Edition 2024 requires extern blocks to be marked `unsafe`, so the Windows build target failed under Rust 1.95. Mac/Linux unaffected (their `#[cfg(unix)]` path uses `setsid(2)` instead). 0.1.0 published to crates.io but Windows users could not `cargo install gobby-hooks`. (#124)
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog entry hard-codes that the failure happened under “Rust 1.95”, but this crate (and the workspace) declares rust-version = "1.85" and the repo uses an unpinned stable toolchain (rust-toolchain.toml). To avoid an easily-stale or potentially inconsistent detail, consider phrasing this as “Rust (edition 2024)” or “Rust >= 1.85 / edition 2024” instead of naming a specific compiler version.

Suggested change
- **Windows build**`crates/ghook/src/detach.rs` declared `extern "system" { fn FreeConsole() -> i32; }` for the Windows-only `FreeConsole()` call. Edition 2024 requires extern blocks to be marked `unsafe`, so the Windows build target failed under Rust 1.95. Mac/Linux unaffected (their `#[cfg(unix)]` path uses `setsid(2)` instead). 0.1.0 published to crates.io but Windows users could not `cargo install gobby-hooks`. (#124)
- **Windows build**`crates/ghook/src/detach.rs` declared `extern "system" { fn FreeConsole() -> i32; }` for the Windows-only `FreeConsole()` call. Rust edition 2024 requires extern blocks to be marked `unsafe`, so the Windows build target failed on edition-2024 toolchains. Mac/Linux unaffected (their `#[cfg(unix)]` path uses `setsid(2)` instead). 0.1.0 published to crates.io but Windows users could not `cargo install gobby-hooks`. (#124)

Copilot uses AI. Check for mistakes.
@joshwilhelmi joshwilhelmi deleted the hotfix/ghook-0.1.1 branch April 17, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants